package com.chaosj.tools.rules

import com.chaosj.tools.StockDiscoverTools

/**
 * @Description: 前天涨停,昨天大涨后下跌,今天高开异动
 * @author caoyangjie
 * @date 2020年03月2020/3/11日 10:56
 * @Copyright: © 赢时胜
 */
class UpRule3 implements IAbnormalRule{
    @Override
    boolean execute(String stockName, List<StockDiscoverTools.DescriptionStock> stocks) {
        int tInd = stocks.size()
        if( stocks.get(tInd-2).dailyLimit() && stocks.get(tInd-1).upDownFlag()== StockDiscoverTools.ResultEnum.LIMIT_DOWN && stocks.get(tInd).upDownFlag()== StockDiscoverTools.ResultEnum.UP ){
            println(description(stockName,stocks.get(tInd).todayUp()*100-100))
            return true
        }
        return false
    }

    @Override
    boolean support(String stockName, List<StockDiscoverTools.DescriptionStock> stocks) {
        return stocks.size()>=3
    }

    @Override
    String description(Object... desc) {
        return String.format("[%s]前天涨停,昨天大涨后回调,今天开盘竞价上涨%s个点,请注意是否为抢手票",desc)
    }
}
